/*
 * @Author: your name
 * @Date: 2021-07-24 00:37:18
 * @LastEditTime: 2021-07-24 11:16:48
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \hairdressing_web\src\services\qianbao\index.js
 */
import api from '../../common/config/api-url'
import Vue from 'vue'
export default {
  list: data => {
    return new Promise(resolve => {
      Vue.prototype.$u.get(api.qianbao.list + '?page=' + data.page + '&limit=' + data.limit).then(
        r => {
          if (r && r.code === 0) {
            resolve(r.data)
          }
        },
        e => {
          wx.showToast({
            title: e.msg,
            icon: 'none',
            duration: 2000
          })
        }
      )
    })
  },
  info: data => {
    return new Promise(resolve => {
      Vue.prototype.$u.get(api.qianbao.user, data).then(
        r => {
          if (r && r.code === 0) {
            resolve(r.data)
          }
        },
        e => {
          wx.showToast({
            title: e.msg,
            icon: 'none',
            duration: 2000
          })
        }
      )
    })
  },
  tixian: data => {
    return new Promise(resolve => {
      Vue.prototype.$u.get(api.qianbao.tixian).then(
        r => {
          if (r && r.code === 0) {
            resolve(r.data)
          }
        },
        e => {
          wx.showToast({
            title: e.msg,
            icon: 'none',
            duration: 2000
          })
        }
      )
    })
  },
}
